Discourage the use of transmute to construct invalid values#388
Merged
ehuss merged 1 commit intorust-lang:masterfrom Dec 30, 2022
Merged
Discourage the use of transmute to construct invalid values#388ehuss merged 1 commit intorust-lang:masterfrom
ehuss merged 1 commit intorust-lang:masterfrom
Conversation
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
Jan 2, 2023
Update books ## rust-lang/book 3 commits in a60f4316ec923a5ac2ed6a2eba6960edb832d855..2bd5d42c9956369132228da6409f0e68da56c51a 2022-12-22 21:37:10 UTC to 2022-12-22 21:36:14 UTC - fix macos installation problem (rust-lang/book#3469) - Update -guessing-game-tutorial incorrect output (rust-lang/book#3462) - FIX: IT repo updated (rust-lang/book#3454) ## rust-lang/nomicon 1 commits in dd37e21ccee43918ed18a71581bb2af537ffe4fc..8ca261268068d80c0969260fff15199bad87b587 2022-12-30 16:32:09 UTC to 2022-12-30 16:32:09 UTC - Discourage the use of transmute to construct invalid values (rust-lang/nomicon#388) ## rust-lang/rust-by-example 6 commits in 995df09b65c582eb6290ab7ea5d9485983eb4c37..8888f9428fe9a48f31de6bd2cef9b9bf80791edc 2023-01-01 12:53:50 UTC to 2022-12-21 10:18:31 UTC - types/alias: use io::{Result,Error} instead of Io{Result,Error} (rust-lang/rust-by-example#1660) - Fix sample code mismatching its comments (rust-lang/rust-by-example#1659) - fix: add missing space (rust-lang/rust-by-example#1658) - diverging: fix issues with example code (rust-lang/rust-by-example#1631) - Update enum.md (rust-lang/rust-by-example#1645) - Clean up Chapter 2 (Primitives) (rust-lang/rust-by-example#1651) ## rust-lang/rustc-dev-guide 5 commits in 8b42eb5..b3e2a6e 2023-01-01 05:20:47 UTC to 2022-12-25 12:11:21 UTC - Add help for when you update a submodule by accident (rust-lang/rustc-dev-guide#1537) - Simplify "how to build and run" section (rust-lang/rustc-dev-guide#1528) - Replace `$TARGET` with `host` (rust-lang/rustc-dev-guide#1514) - Add more rebasing help (rust-lang/rustc-dev-guide#1536) - Fix rustc_borrowck crate name typo (rust-lang/rustc-dev-guide#1535)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating null values of non-null types with transmute is undefined behavior, and the nomicon doesn't explicitly say that in the "nullable pointer optimization" chapter. Hopefully this comment will discourage the use of transmute in this case a little bit more.